﻿# -*- coding: utf-8 -*-
import os
import re
def mylistdir(p,f):
    a=os.listdir(p)
    fs=myfind(a,f)
    return(fs)
def myfind(l,p):
    lr=[];
    #print p
    p1=p.replace(".",r"\.")
    p2=p1.replace("*",".*")
    p2=p2+"$"
    p2="^"+p2
    for a in l:
        #print a
        if  re.search(p2,a,re.IGNORECASE)==None :
           pass
           #print "pass"
        else:
           lr.append(a)
       #print "append"
    return lr
def ison():
    rundir=os.path.abspath(os.curdir)
    bh=rundir.split("\\")[-1]
    print(bh)
    if bh[:3]=="411":
        iscs=True
    else:
        iscs=False
    return not iscs
def getbh():
    rundir=os.path.abspath(os.curdir)
    bh=rundir.split("\\")[-1]
    return bh
def main():
    pass
if __name__=="__main__":
    main()
